/**
 * 
 */
var tmp1 = new Array();
var tmp2 = new Array();
var tmp3 = new Array();

function wpxx(){
	 

	

	$.ajax( {
		type : "get",
		url : "/jeesite/a/wpxxjk/testJkWpxx/ajaxwpxxjk",
//		data: {"top3":value},
		dataType:"json",
		success : function(list) {
        alert(123456789);
  
		draw_graph(list);

		var object1 = list[0];
		var object2 = list[1];
		var object3 = list[2];
		
		tmp1.push({ value: parseFloat(object1.wpbl).toFixed(2),name:object1.nsrmc});
		tmp2.push({ value: parseFloat(object2.wpbl).toFixed(2),name:object2.nsrmc});
		tmp3.push({ value: parseFloat(object3.wpbl).toFixed(2),name:object3.nsrmc});


		
		
		
		
		
		
		
		
		
		
		},
		
        error: function (XMLHttpRequest, textStatus, errorThrown) {
        alert(9876543210);
} 
	});
	
 }
function draw_graph(list){
	
	$("#contentTable").hide();
	$(".pagination").hide();
	$("#wpxx").show();
   // 路径配置
        require.config({
            paths: {
                echarts: '/jeesite/static/dist'
            }
        });        
             
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/pie',// 使用柱状图就加载bar模块，按需加载
                'echarts/chart/gauge'
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('wpxx'));
                    
               
      
                var   option = {
                			    tooltip : {
                			        formatter: "{a} <br/>{b} : {c}%"
                			    },
                			    toolbox: {
                			        show : true,
                			        feature : {
                			            mark : {show: true},
                			            restore : {show: true},
                			            saveAsImage : {show: true}
                			        }
                			    },
                			    series : [
                			        {  
                			            name:'预警信息',
                			            center:['20%','50%'],
                			            radius:['0','180'],
                			            type:'gauge',
                			            detail : {formatter:'{value}%'},
                			            data:tmp1
                			        },
                			        {
                			            name:'预警信息',
                			            center:['50%','50%'],
                			            radius:['0','180'],
                			            type:'gauge',
                			            detail : {formatter:'{value}%'},
                			            data:tmp2
                			        },
                			        {
                			            name:'预警信息',
                			            center:['80%','50%'],
                			            radius:['0','180'],
                			            type:'gauge',
                			            detail : {formatter:'{value}%'},
                			            data:tmp3
                			        }
                			        
                			    ]
                			};

                // 为echarts对象加载数据 
                myChart.setOption(option); 
                
            }
        );
}